package com.example.openim.controller;

import com.example.openim.service.UserQueryService;
import com.example.openim.utils.AjaxResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: ZhangHuixin
 * @created: 2025-11-04 10:03:03
 */
@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/in")
public class UserController {

    private final UserQueryService userQueryService;

    @GetMapping("/queryUser")
    public AjaxResult queryUser(String zbmId) {
        return AjaxResult.success(this.userQueryService.findUsers(zbmId));
    }

    @GetMapping("/queryByPhone")
    public AjaxResult queryByPhone(String phone, String userId) {
        return AjaxResult.success(this.userQueryService.queryByPhone(phone, userId));
    }

    @GetMapping("/querySearch")
    public AjaxResult querySearch(String search) {
        return AjaxResult.success(this.userQueryService.querySearch(search));
    }


}
